package com.miplus.ccrm.core.service.crd;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.core.controller.vo.credit.CrdBillHistReqVo;
import com.miplus.ccrm.core.controller.vo.credit.CrdBillHistResVo;
import com.miplus.ccrm.core.pojo.CreditAccountBillhist;
import com.miplus.ccrm.core.mapper.CreditAccountBillhistMapper;
import org.springframework.stereotype.Service;

/**
* @author pc
* @description 针对表【credit_account_billhist】的数据库操作Service实现
* @createDate 2024-04-16 14:34:42
*/
@Service
public class CreditAccountBillhistServiceImpl extends MPJBaseServiceImpl<CreditAccountBillhistMapper, CreditAccountBillhist>
    implements CreditAccountBillhistService{

    @Override
    public IPage<CrdBillHistResVo> crdBillHistList(CrdBillHistReqVo paras)
    {
        return selectJoinListPage(new Page<>(paras.getPageNum(), paras.getPageSize()),
                CrdBillHistResVo.class,
                new MPJLambdaWrapper<CreditAccountBillhist>()
                        .selectAll(CreditAccountBillhist.class)
                        .eq(CreditAccountBillhist::getAcct,paras.getAcctno())
                        .orderByDesc(CreditAccountBillhist::getBillDate)
        );
    }
}




